<?php
namespace app\index\controller;

use think\Controller;

class Index extends  Controller
{
    //魔术常量针对的是它所在的文件而言的
    public function index()
    {
        //__DIR__代表着当前文件所在的目录
        echo __DIR__;
        echo "</br>";
        echo "代表当前所在文件所在的行";
        echo __LINE__;
        echo "</br>";
        echo "代表当所在的类，包含命名空间";
        echo __CLASS__;
        echo "</br>";
        echo "当前文件名的绝对路径";
        echo __FILE__;
        echo "</br>";
        echo "当前函数";
        echo __FUNCTION__;
        echo  "</br>";
        echo "当前方法，包括类所在的命名空间";
        echo __METHOD__;
        echo "</br>";
        echo APP_PATH;
    }
    
    //路径常量验证
    public function ChangLiang(){
        
        dump(THINK_VERSION,true,"THINK_VERSION");
        dump(THINK_START_TIME,true,"THINK_START_TIME");
        dump(THINK_START_MEM,true,"THINK_START_MEM");
        dump(EXT,true,"EXT");
        dump(DS,true,"DS");
        dump(THINK_PATH,true,"THINK_PATH");
        dump(LIB_PATH,true,"LIB_PATH");
        dump(CORE_PATH,true,"CORE_PATH");
        dump(TRAIT_PATH,true,"TRAIT_PATH");
        dump(APP_PATH,true,"APP_PATH");
        dump(ROOT_PATH,true,"ROOT_PATH");
        dump(EXTEND_PATH,true,"EXTEND_PATH");
        dump(VENDOR_PATH,true,"VENDOR_PATH");
        dump(RUNTIME_PATH,true,"RUNTIME_PATH");
        dump(LOG_PATH,true,"LOG_PATH");
        dump(CACHE_PATH,true,"CACHE_PATH");
        dump(TEMP_PATH,true,"TEMP_PATH");
        dump(CONF_PATH,true,"CONF_PATH");
        dump(ENV_PREFIX,true,"ENV_PREFIX");
    }
    
    //$_SERVER变量
    public function serverDump(){
        dump($_SERVER,true,'server');
    }
    
    
}
